
#include "ti_msp_dl_config.h"

#define LED_PORT GPIO_GRP_0_LED_PORT 
#define LED_PIN GPIO_GRP_0_LED_PIN  
#define LED_IOMUX GPIO_GRP_0_LED_IOMUX 
#define KEY_PORT GPIO_GRP_0_KEY_PORT 
#define KEY_PIN GPIO_GRP_0_KEY_PIN 
#define KEY_IOMUX GPIO_GRP_0_KEY_IOMUX 
void Delay(unsigned int ms) {
    for (volatile unsigned int i = 0; i < ms * 1000; i++);}
int main(void) {
    SYSCFG_DL_init();

    DL_GPIO_initDigitalOutput(LED_IOMUX); 
    DL_GPIO_initDigitalInput(KEY_IOMUX);  

    DL_GPIO_clearPins(LED_PORT, LED_PIN);

    bool last_button_state = false;  
    bool current_button_state;       

    while (1) {
        current_button_state = (DL_GPIO_readPins(KEY_PORT, KEY_PIN) != 0);

        if (current_button_state !=1) {
            Delay(20);  DL_GPIO_togglePins(LED_PORT, LED_PIN);}
            
         
   }
}
